﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using KCL.Code.Data;

namespace KCL.Code.Business
{
    public class ProductServices
    {
        public static List<Product> GetAllProducts()
        {
            return (new ProductDAO()).GetAllProducts();
        }

        public static bool Insert(Product p)
        {
            return (new ProductDAO()).Insert(p);
        }

        public static bool Update(Product p)
        {
            p.isActive = true;
            return (new ProductDAO()).Update(p);
        }

        public static bool Delete(Product p)
        {
            return (new ProductDAO()).Delete(p);
        }

        public static string GetNextProductCode()
        {
            return (new ProductDAO()).GetNextProductCode();
        }
    }
}